package com.kangfu.db.domain.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.time.LocalDateTime;

/**
 * 聊天消息对象 message
 * 
 * @author ruoyi
 * @date 2022-08-29
 */
public class Message
{
    private static final long serialVersionUID = 1L;

    /** 主键ID */
    private Integer id;

    /** user.id */
    private Integer userId;

    /** sys_user.id */
    private Integer sysUserId;

    /** 消息来源：(0:user，1:sys_user) */
    private Integer source;

    /** 消息类型：(0:文字，1:图片) */
    private Integer type;

    /** 消息内容 */
    private String content;

    /** 是否已读(0:未读，1:已读) */
    private Integer userReadFlag;

    /** 是否已读(0:未读，1:已读) */
    private Integer sysUserReadFlag;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime sendTime;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    public void setId(Integer id) 
    {
        this.id = id;
    }

    public Integer getId() 
    {
        return id;
    }
    public void setUserId(Integer userId) 
    {
        this.userId = userId;
    }

    public Integer getUserId() 
    {
        return userId;
    }
    public void setSysUserId(Integer sysUserId) 
    {
        this.sysUserId = sysUserId;
    }

    public Integer getSysUserId() 
    {
        return sysUserId;
    }
    public void setSource(Integer source) 
    {
        this.source = source;
    }

    public Integer getSource() 
    {
        return source;
    }
    public void setType(Integer type) 
    {
        this.type = type;
    }

    public Integer getType() 
    {
        return type;
    }
    public void setContent(String content) 
    {
        this.content = content;
    }

    public String getContent() 
    {
        return content;
    }

    public Integer getUserReadFlag() {
        return userReadFlag;
    }

    public void setUserReadFlag(Integer userReadFlag) {
        this.userReadFlag = userReadFlag;
    }

    public Integer getSysUserReadFlag() {
        return sysUserReadFlag;
    }

    public void setSysUserReadFlag(Integer sysUserReadFlag) {
        this.sysUserReadFlag = sysUserReadFlag;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public LocalDateTime getSendTime() {
        return sendTime;
    }

    public void setSendTime(LocalDateTime sendTime) {
        this.sendTime = sendTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("userId", getUserId())
            .append("sysUserId", getSysUserId())
            .append("source", getSource())
            .append("type", getType())
            .append("content", getContent())
            .append("userResdFlag", getUserReadFlag())
            .append("sysUserResdFlag", getSysUserReadFlag())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
